package com.auto.signup.weixin;


import com.auto.signup.weixin.exception.AuthException;
import com.auto.signup.weixin.model.WebAuthTokenModel;

/**
 * 微信网页授权 接口
 * 
 * @author randyjie
 *
 */
public interface WeixinWebAuth {
	// redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
	/**
	 * 构建授权code url
	 * 
	 * @param redirectUri
	 *            callback url
	 * @param scope
	 *            WebAuthScopeEnum
	 * @param state
	 *            开发自定义参数；开发者可以填写a-zA-Z0-9的参数值，最多128字节
	 * @return
	 */
	public String buildAuthURL(String redirectUri, WebAuthScopeEnum scope, String state);

	/**
	 * 微信网页授权 通过code 获取TOKEN 用户ID等信息
	 * 
	 * @param code
	 * @return
	 * @throws AuthException
	 */
	public WebAuthTokenModel getAuthToken(String code) throws AuthException;

}
